package day9;

import java.util.Random;
import java.util.Scanner;

public class A3 {
    public static void main(String[] args) {
        String text = "jdk";
        text = text.toUpperCase();
        System.out.println("大写后:"+text);
        text = text.substring(1);
        System.out.println("截取后:"+text);
    }
}

class B3 {
    public static void main(String[] args) {
        String s = "name=zhangsan age=18 classNo=090728";
        System.out.println("原字符串:" + s);
        String[] strs = s.split(" ");
        System.out.println("拆分后:");
        for (String str : strs) {
            System.out.print(str.substring(str.lastIndexOf('=') + 1) + " ");
        }
    }
}

class C3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str = sc.next();
        for (int i = 0; i < str.length()/2; i++) {
            if (str.charAt(i) != str.charAt(str.length()-i-1)) {
                System.out.println("字符串不对称");
                return;
            }
        }
        System.out.println("字符串对称");
    }
}

class A4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数组长度:");
        int n = sc.nextInt();
        char[] chars = new char[n];
        Random random = new Random();
        for (int i = 0; i < n; i++) {
            int choice = random.nextInt(3);
            switch (choice) {
                case 0:chars[i]=(char)(random.nextInt(10)+48);break;
                case 1:chars[i]=(char)(random.nextInt(26)+65);break;
                case 2:chars[i]=(char)(random.nextInt(26)+97);break;
            }
        }
        System.out.println(new String(chars));
    }
}

class B4{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串:");
        String str = sc.next();
        String str1 = "";
        String str2 = "";
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i)>='A'&&str.charAt(i)<='Z') {
                str1+=str.charAt(i);
            }
            else {
                str2+=str.charAt(i);
            }
        }
        System.out.println(str2+str1);
    }
}

class C4{
    public static void main(String[] args){
        int num = 5;
        //char ch = (char) (num + '0');
        System.out.println(1+'0');
    }
}